<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="java.util.*" %>

<html>
<head>
	<title>List Mom</title>
	<link rel="stylesheet" type="text/css" href="resources/css/css.css">
	<script type="text/javascript" src="resources/js/jquery-1.3.2.min.js"></script>
</head>
<body>
<h1>List Mom</h1>
<p>
<a href="addMom">Add Mom</a>
</p>
<div class="descColor">
	<span class="t500">More 500</span><br/>
	<span class="t300">More 300</span><br/>
	<span class="black">Normol</span><br/>
</div>




<table border="1" class="tableList">
	<tr>
		<td>Totle Price :</td><td class="gray">${totlePrice}</td>
		<td>Price - 20% :</td><td class="gray">${totlePrice20Percen}</td>
	</tr>
	<tr>
		<td>Top Count Number :</td><td class="gray">${mapTopCount} num From 100 num</td>
		<td>Down Count Number :</td><td class="gray">${mapDownCount} num From 100 num</td>
	</tr>
</table>











<%
Map<String,Integer> mapTop = (Map<String,Integer>)request.getAttribute("mapTop");
Map<String,Integer> mapDown = (Map<String,Integer>)request.getAttribute("mapDown");
String index = "";
String stlyeClass = "";

%>
<%for(int i=0;i<100;i++){  
    
    if(i<10)index= "0"+i;
    else index= ""+i;
%>
	<%if(i % 10 == 0){ %><div class="clear"></div><%} %>
	<div class ="tableDiv">
	<span class="number blue"><%=index %></span>
	<br />
	top:
	<% 
	stlyeClass = "black";
	if(mapTop.containsKey(index)){if(mapTop.get(index) > 300){ stlyeClass="t300";}}
	if(mapTop.containsKey(index)){if(mapTop.get(index) > 500){ stlyeClass="t500";}}
	%>
	<span class="<%=stlyeClass%>">
		<%if(mapTop.containsKey(index)){out.println(mapTop.get(index));}else{out.println("-");}%>
	</span>
	<br/>
	down:
	<% 
	stlyeClass = "black";
	if(mapDown.containsKey(index)){if(mapDown.get(index) > 300){ stlyeClass="t300";}}
	if(mapDown.containsKey(index)){if(mapDown.get(index) > 500){ stlyeClass="t500";}}
	%>
	<span class="<%=stlyeClass%>">
		<%if(mapDown.containsKey(index)){out.println(mapDown.get(index));}else{out.println("-");}%>
	</span>
	
	
	</div> 

<%} %>
<br />
<br />

<br />
<div class="clear"></div>
<br />
<%
out.println("Top>>"+mapTop+"<br/>");
out.println("Down >>"+mapDown);
%>
<br /><br />

</body>
</html>
